function [data]=drawhalfmoon()

clc;
clear;
x1 = [-1:0.01:1];
y1 = sqrt(1-x1.^2);
y1 = awgn(y1,25);

x2 = x1+0.8;
y2 = -sqrt(1-(x2-0.8).^2);
y2 = awgn(y2,25)+0.7;

x1 = awgn(x1,25);
x2 = awgn(x2,25);

plot(x1,y1,'r.',x2,y2, 'b.');
axis([-1.5 2 -1.0 1.2]);


data = [x1' y1'];
N1   = size(data,1);
hmoon.Y(1:N1,1)    = 1;
data = [data; x2' y2'];
N2   = size(data,1);
hmoon.Y(N1+1:N2,1) = 2;


hmoon.X = data;


save('hmoondata.mat','-struct','hmoon');

fp=fopen('halfmoondata.txt','w+');
for i=1:size(data,1)
 fprintf(fp,'1:%f 2:%f\n', data(i,1), data(i,2));
end
fclose(fp);






